package com.example.service

import org.springframework.stereotype.Service

@Service
class FileServiceImpl implements FileService {

	@Override
	public String readTextByName(String fileName) {

		def file = new File("d://groovyTest/"+fileName)

		return file.text;
	}

	@Override
	public void saveText(String fileName,String fileContent) {

		new File("d://groovyTest/"+fileName).withWriter('utf-8') { writer ->
			writer.writeLine(fileContent)
		}
	}
}
